package com.heima.skydemo.domin.common;

import lombok.Data;

import javax.print.attribute.ResolutionSyntax;
import java.io.Serializable;
@Data
public class Result<T> implements Serializable {
    private String msg;
    private Integer code;
    private T data;
    public static<T> Result<T> success(){
        Result<T> result = new Result<T>();
        result.code = 1;
        return result;
    }
    public static<T> Result<T> success(T data){
        Result<T> result = new Result<>();
        result.code = 1;
        result.data = data;
        return result;
    }
    public static<T> Result<T> error(String msg){
        Result<T> result = new Result<>();
        result.code = 0;
        result.msg = msg;
        return result;
    }

}
